<?php

/**
 * Search result
 * @package local.includes.
 * @author viethd
 * @version $Id$
 * @copyright 2009 LHV Company
 */
class SearchResult {

    protected $rawData = array();

    function __construct($data) {
        $this->rawData = $data;
    }

    public function getPersonId() {
        if (isset($this->rawData['person_id'])) {
            return $this->rawData['person_id'];
        }
    }

    public function getPatientCode() {
        if (isset($this->rawData['patient_code'])) {
            return $this->rawData['patient_code'];
        }
    }

    public function getPatientName() {
        if (isset($this->rawData['name'])) {
            return $this->rawData['name'];
        }
    }
    public function getPatientDOB() {
        if (isset($this->rawData['date_of_birth'])) {
            return $this->rawData['date_of_birth'];
        }
    }
    public function getPatientPhone() {
        if (isset($this->rawData['phone_number'])) {
            return $this->rawData['phone_number'];
        }
    }
    public function getPatientAddress() {
        $province = '';
        $district = '';
        $ward = '';
        $street = '';
        if (isset($this->rawData['province'])) {
            $province = $this->rawData['province'];            
        }
        
        if (isset($this->rawData['district'])) {
            $district = $this->rawData['district'];            
        }
        
        if (isset($this->rawData['ward'])) {
            $ward = $this->rawData['ward'];            
        }
        
        if (isset($this->rawData['street'])) {
            $street = $this->rawData['street'];            
        }
        
        return L10nHelper::getAddress($province, $district, $ward, $street);
    }
    public function getPatientEmail() {
        if (isset($this->rawData['email'])) {
            return $this->rawData['email'];
        }
    }
    public function getGender() {
        if (isset($this->rawData['gender'])) {
            return $this->rawData['gender'];
        }
    }
}
?>